#!/bin/bash

FILES=merge.hdf

for I in $FILES
  do

  echo "Results: " > $I.chk
 
#  ./rightdownsegmentation $I seg-rdn-$I 
  ./mergesegmentation $I seg-mrg-$I
  ./graphsegmentation $I seg-gra-$I
#  ./simannsegmentation $I seg-sma-$I

  echo >> $I.chk
  echo "Segments: " >> $I.chk
  
  for J in `ls seg-*-$I`
    do
    echo >> $I.chk
    echo $J >> $I.chk
    ./segmentchecker $J >> $I.chk
    
  done  

# #  ./isodatacluster $I clu-iso-$I
# # ./simanncluster $I clu-sma-$I

#   for J in `ls seg-???-$I`
#    do
#     ./segisodatacluster $I $J clu-iso-$J
# #   ./segsimanncluster $I $J clu-sma-$J
#   done

    
#   echo >> $I.chk 
#   echo "Clusters: " >> $I.chk
   
#   for J in `ls clu-*-$I`
#     do
#     echo >> $I.chk 
#     echo $J >> $I.chk
#     ./clusterchecker $J checker.hdf >> $I.chk

#   done
  
    
# #   for J in `ls clu-???-$I`
# #   do
# # #    ./oldclassify $J reference.hdf cla-old-$J
# #     echo "" >> $I.chk
# #     echo "Pixel classify: " cla-pix-$J >> $I.chk
# #     ./pixelclassify $I $J reference.hdf cla-pix-$J >> $I.chk
# # #    ./advancedclassify $I $J reference.hdf cla-adv-$J
# #   done

    
  for J in `ls seg-???-$I`
    do
      ./segmaxlhclassify $I $J reference.hdf cla-sml-$J >> $I.chk
    # for K in `ls clu-???-$J`
    #   do
    #   echo "" >> $I.chk
    #   echo "Segment classify: " cla-seg-$K >> $I.chk
    #   ./segclassify $I $J $K reference.hdf cla-seg-$K >> $I.chk
    # done      
  done

#  ./mindistclassify $I reference.hdf cla-mds-$I
#  ./maxlhclassify $I reference.hdf cla-mlh-$I
#  ./minchisqrclassify $I reference.hdf cla-mcs-$I
#  ./simannclassify $I reference.hdf cla-sma-$I

     
  echo >> $I.chk 
  echo "Classes: " >> $I.chk
  
  for J in `ls cla-*-$I`
    do
    echo >> $I.chk
    echo $J >> $I.chk
    ./checker $J checker.hdf >> $I.chk
    
  done
  
done
